﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true"
    CodeBehind="ItemQuery.aspx.cs" Inherits="Cn.Cellula.Website.Admin.Item.ItemQuery" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link type="text/css" rel="Stylesheet" href="/Cellula_Client/controls/JskitControls.css" />
    <script type="text/javascript" src="/jskit.org/model/controls/JskitRichDropDownList.js"></script>
    <script type="text/javascript" src="/Cellula_client/BizClient/ItemQuery.js"></script>
    <script type="text/javascript">
        var FillQueryData = function () {
            var qd = $("#" + fixId("hid_QueryData"));
            if (qd != null) {
                var str = qd.value;
                if (str.length < 1) return;
                var items = str.split(',');
                var obj = null;
                var refKey = null;
                var val = null;
                var id = null;
                var type = null;
                var item = null;
                for (var i = 0; i < items.length; i++) {
                    item = items[i].split(":");
                    id = item[0];
                    val = item[1];
                    refKey = item[2];
                    type = item[3];
                    obj = $("#" + id);
                    if (obj != null) {
                        if (type == "ddl") {
                            for (var j = 0; j < obj.childNodes.length; j++) {
                                if (obj.childNodes[j].getAttribute("value") == val) {
                                    obj.childNodes[j].setAttribute("selected", "selected");
                                    break;
                                }
                            }
                        } else if (type == "rddl") {
                            $("#" + id+"_ref").value = refKey;
                            obj.value = val;
                        } else {
                            obj.value = val;
                        }
                    }
                }
                obj = val = id = type = refKey = item = null;
            }
        };
        function PageOnLoad() {
            FillQueryData();
        }

        var itemQuery = new ItemQuery("itemQuery");
        itemQuery.setListBoxId("QueryList_Panel");
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="CPH_PageTitle" runat="server">
    对象高级搜索
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="CPH_MainBody" runat="server">
    <asp:HiddenField runat="server" ID="hid_AtlKeys" />
    <asp:HiddenField runat="server" ID="hid_QueryData" />
    <div class="action_bar">
        <asp:Button runat="server" ID="btn_Query" Text="搜索" OnClientClick="itemQuery.load();return false;" CssClass="action_btn"  />
    </div>
    <div style="float:left; width:320px;">
        <fieldset style="width:300px;">
            <legend>基础搜索项</legend>
            <table cellpadding="0" cellspacing="0" border="0" class="item_atl_qform">
                <tr class="item_atl_qform_row0">
                    <td class="item_atl_qform_name">
                        选择分类：
                    </td>
                    <td class="item_atl_qform_field">
                        <asp:DropDownList runat="server" ID="ddl_Category" AutoPostBack="true"
                            onselectedindexchanged="ddl_Category_SelectedIndexChanged">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr class="item_atl_qform_row1">
                    <td class="item_atl_qform_name">
                        关键字：
                    </td>
                    <td class="item_atl_qform_field">
                        <asp:TextBox runat="server" ID="txt_QueryKey"></asp:TextBox>
                    </td>
                </tr>
            </table>
        </fieldset>
         <fieldset style="width:300px;">
            <legend>扩展搜索项</legend>
           <asp:Label runat="server" ID="lab_QueryForm" EnableViewState="true" Width="280px"></asp:Label>
        </fieldset>
    </div>
    <div style="float:left; width:670px">
        <fieldset style="width:650px">
            <legend>搜索结果：<input type="radio" checked="checked" value="0" name="list_style" id="rad_list" />列表形式
                <input type="radio" value="1" name="list_style" id="rad_report" />报表形式</legend>
            <asp:Label runat="server" ID="lab_QueryList"></asp:Label>
            <div id="QueryList_Panel"></div>
        </fieldset>
    </div>
</asp:Content>
